From 1f66881925afc33113faa3d372a13c60e1e6b197 Mon Sep 17 00:00:00 2001 From: Alastair Tse Date: Wed, 31 Jan 2007 15:03:22 +0000 Subject: [PATCH] [XEND] Make VBD.bootable in XendConfig kept as int. This will prevent it from being displayed as 'False' and 'True' everywhere in the device SXP. Signed-off-by: Alastair Tse --- tools/python/xen/xend/XendConfig.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py index a3c5398b49..81c1323a2c 100644 --- a/tools/python/xen/xend/XendConfig.py +++ b/tools/python/xen/xend/XendConfig.py @@ -905,7 +905,7 @@ class XendConfig(dict): # store as part of the device config. dev_uuid = sxp.child_value(config, 'uuid') dev_type, dev_cfg = self['devices'][dev_uuid] - is_bootable = dev_cfg.get('bootable', False) + is_bootable = dev_cfg.get('bootable', 0) config.append(['bootable', int(is_bootable)]) sxpr.append(['device', config]) @@ -978,7 +978,7 @@ class XendConfig(dict): pass if dev_type == 'vbd': - dev_info['bootable'] = False + dev_info['bootable'] = 0 if dev_info.get('dev', '').startswith('ioemu:'): dev_info['driver'] = 'ioemu' else: @@ -998,7 +998,7 @@ class XendConfig(dict): if dev_type == 'vbd' and not target[param]: # Compat hack -- this is the first disk, so mark it # bootable. - dev_info['bootable'] = True + dev_info['bootable'] = 1 target[param].append(dev_uuid) elif dev_type == 'tap': if 'vbd_refs' not in target: @@ -1007,7 +1007,7 @@ class XendConfig(dict): if not target['vbd_refs']: # Compat hack -- this is the first disk, so mark it # bootable. - dev_info['bootable'] = True + dev_info['bootable'] = 1 target['vbd_refs'].append(dev_uuid) elif dev_type == 'vfb': @@ -1070,8 +1070,8 @@ class XendConfig(dict): dev_info['uname'] = cfg_xenapi.get('image', '') dev_info['dev'] = '%s:%s' % (cfg_xenapi.get('device'), old_vbd_type) - dev_info['bootable'] = cfg_xenapi.get('bootable', False) - dev_info['driver'] = cfg_xenapi.get('driver') + dev_info['bootable'] = int(cfg_xenapi.get('bootable', 0)) + dev_info['driver'] = cfg_xenapi.get('driver', '') dev_info['VDI'] = cfg_xenapi.get('VDI', '') if cfg_xenapi.get('mode') == 'RW': -- 2.30.2